﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Public;
using BUS;

namespace QuanLyKhoHangVatTu
{
    public partial class ChiTietNhaCungCap : DevExpress.XtraEditors.XtraForm, IChildForm
    {
        NhaCungCap_BUS ncc_bus = new NhaCungCap_BUS();
        NhaCungCap_PB ncc_pb = new NhaCungCap_PB();
        public ChiTietNhaCungCap()
        {
            InitializeComponent();
        }

        private void ChiTietNhaCungCap_Load(object sender, EventArgs e)
        {
            Nap();
            
        }
        public void Nap()
        {
            gridNhaCungCap.DataSource = ncc_bus.LayDSNCC();
        }
        public void Them()
        {
            NhaCungCap ncc = new NhaCungCap();
            ncc.Tag = this;
            ncc.ShowDialog();
            Nap();
        }

        public void Sua()
        {
            // lay gia tri dang chọn tren grd moi dung

            DataRow r = gridView1.GetFocusedDataRow();
            if (r == null) return;

            DonViTinh dvt = new DonViTinh(r["MADONVITINH"].ToString(), r["DIENGIAI"].ToString());

            dvt.Tag = this;
            dvt.ShowDialog();
            Nap();
        }
        public void Xoa()
        {
           
            Nap();
        }
    }
}